<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>订单详情</title>
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bui.css" />
</head>
<body>
<style>
    .page-form .bui-fluid-space-3 .span1 {
        margin-bottom: .2rem;
    }

    .selected-val {
        margin-right: .1rem;
    }
</style>
<div class="bui-page page-form">
    <header class="bui-bar">
        <div class="bui-bar-left"> <a class="bui-btn btn-back" id="backupButton" ><i class="icon-back"></i></a> </div>
        <div class="bui-bar-main">收付款详情</div>
        <div class="bui-bar-right"> </div>
    </header>
    <main>
        <ul class="bui-list" id="xxlist">
<!--            <li class="bui-btn-title">-->
<!--                付款方：XXXX  &nbsp;&nbsp;&nbsp;&nbsp;收款方：XXXX-->
<!--            </li>-->
<!--            <li class="bui-btn bui-box">-->
<!--                <div class="span1">-->
<!--                    <h3 class="item-title">预付款</h3>-->
<!--                    <p class="item-text"><span class="bui-label">状态</span><span class="bui-value">未支付</span</p>-->
<!--                    <p class="item-text"><span class="bui-label">付款时间</span><span class="bui-value">2018-02-02 15:04</span></p>-->
<!--                </div>-->
<!--            </li>-->
<!--            <li class="bui-btn bui-box">-->
<!--                <div class="span1">-->
<!--                    <h3 class="item-title">尾款</h3>-->
<!--                    <p class="item-text"><span class="bui-label">状态</span><span class="bui-value">未支付</span</p>-->
<!--                    <p class="item-text"><span class="bui-label">付款时间</span><span class="bui-value">2018-02-02 15:04</span></p>-->
<!--                </div>-->
<!--            </li>-->
        </ul>
    </main>
</div>
<!-- 依赖库 手机调试的js引用顺序如下 -->
<script src="../js/zepto.js"></script>
<script src="../js/plugins/fastclick.js"></script>
<script src="../js/bui.js"></script>
<script src="../js/common.js"></script>
<script>
    bui.ready(function () {
        var uiParams = bui.getPageParams();
        uiParams.done(function(result){
            var urlparam = result;
            var ddbm = urlparam.ddbm;
            console.log(urlparam)
            console.log("=============");
            console.log("ddbm:"+ddbm);
            if(ddbm){
                var detailAjax = bui.ajax({
                    url: BASE_URL+"/front/subOrderDetail",
                    // 可选参数
                    data: {
                        ddbm:ddbm
                    },
                    method: "GET"
                });
                detailAjax.then(function(res) {
                    if(res.code == 0){
                        var order  = res.data;
                        if(order){
                            var html = "";
                            for(var i=0;i<order.length;i++){
                                var o = order[i];
                                html += `
                                 <li class="bui-btn-title">
                        付款方：`+(o.XM||'')+`  &nbsp;&nbsp;&nbsp;&nbsp;收款方：`+(o.XM1||'')+`
                    </li>
                    <li class="bui-btn bui-box">
                        <div class="span1">
                            <h3 class="item-title">预付款</h3>
                            <p class="item-text"><span class="bui-label">状态</span><span class="bui-value">`+(o.YFDDZT||'')+`</span</p>
                            <p class="item-text"><span class="bui-label">付款时间</span><span class="bui-value">`+(o.YFFKSJ||'')+`</span></p>
                        </div>
                    </li>
                    <li class="bui-btn bui-box">
                        <div class="span1">
                            <h3 class="item-title">尾款</h3>
                            <p class="item-text"><span class="bui-label">状态</span><span class="bui-value">`+(o.WFDDZT||'')+`</span</p>
                            <p class="item-text"><span class="bui-label">付款时间</span><span class="bui-value">`+(o.WFFKSJ||'')+`</span></p>
                        </div>
                    </li>
                                 `;

                            }

                            $('#xxlist').html(html);
                        }
                    }else{
                        bui.alert(res.msg);
                    }
                },function(res) {
                    bui.alert("请求异常");
                })
            }
        })
        bui.btn({id: ".bui-page", handle: ".bui-btn"}).load();

        $("#backupButton").on("click", function (argument) {
            window.history.go(-1);
        });


    })
</script>
</body>
</html>